package netty;

import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.Slf4JLoggerFactory;

/**
 * describe:网络服务器类基类
 *
 * @author helloworldyu
 * @date 2018/5/3
 */
public abstract class BaseNetworkServer implements INetworkServer {
	/**
	 * 初始化 netty 的日志系统
	 */
	static {
		InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.INSTANCE);
	}

	/**
	 * 默认的端口
	 */
	protected int port = 8080;

	/**
	 * 接收请求的 nio 池
	 */
	protected EventLoopGroup bossGroup = new NioEventLoopGroup();


	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

}